package crazy.framework;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class StudentController implements ActionListener
{
	private StudentModel model;
	private StudentView view;
	
	public StudentController(StudentModel m, StudentView v)
	{
		this.model = m;
		this.view = v;
	}
	
	@Override
	public void actionPerformed(ActionEvent evt)
	{
		Object source = evt.getSource();
		System.out.println("...");
		if (source == view.getUpdateRef())
		{
			updateModel();
		}
	}
	
	private void updateModel()
	{
		model.updateModel(view.getFirstName(), view.getLastName(), view.getCourse(), view.getAddress());
	}
	
}
